"use strict";
Ajax('/api/getlist', (data) => {
    // console.log(data);
    render(data.data);
});
function render(data) {
    //获取渲染位置
    const boxDom = document.querySelector(".box");
    boxDom.innerHTML = data.map(item => {
        return `<div class="item" id="${item.id}">
                    <img src="${item.img}" alt="">
                    <div>
                        <h2>${item.title}</h2>
                    </div>
                </div>
        `;
    }).join('');
}
